# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Sascha Paunovic <azarus@posteo.net>
pkgname=arc-theme
pkgver=20200708
_commit=934e3bfc93506581f5be1194bd6084c5b6b64bf5
pkgrel=0
pkgdesc="Flat theme with transparent elements"
options="!check" # no test suite
url="https://github.com/jnsh/arc-theme"
arch="noarch !mips !mips64" # requires too much RAM on mips
license="GPL-3.0-or-later"
depends="gtk-murrine-engine"
makedepends="automake autoconf glib-dev libtool inkscape optipng sassc"
subpackages="
	arc:arc:noarch
	arc-gtk3:arc_gtk3:noarch
	arc-gtk2:arc_gtk2:noarch
	arc-gnome:arc_gnome:noarch
	arc-xfwm:arc_xfwm:noarch
	arc-openbox:arc_openbox:noarch
	arc-lighter:lighter:noarch
	arc-lighter-gtk3:lighter_gtk3:noarch
	arc-lighter-gtk2:lighter_gtk2:noarch
	arc-lighter-gnome:lighter_gnome:noarch
	arc-lighter-xfwm:lighter_xfwm:noarch
	arc-dark:dark:noarch
	arc-dark-gtk3:dark_gtk3:noarch
	arc-dark-gtk2:dark_gtk2:noarch
	arc-dark-gnome:dark_gnome:noarch
	arc-dark-xfwm:dark_xfwm:noarch
	arc-dark-openbox:dark_openbox:noarch
	arc-darker:darker:noarch
	arc-darker-gtk3:darker_gtk3:noarch
	arc-darker-gtk2:darker_gtk2:noarch
	arc-darker-xfwm:darker_xfwm:noarch
	arc-darker-openbox:darker_openbox:noarch
	"
source="$pkgname-$_commit.tar.gz::https://github.com/jnsh/arc-theme/archive/$_commit.tar.gz"
builddir="$srcdir/$pkgname-$_commit"

prepare() {
	default_prepare
	autoreconf -vif
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-unity \
		--disable-cinnamon \
		--disable-metacity \
		--disable-plank \
		--with-gnome-shell=3.36 \
		--with-gtk3=3.24
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

arc() {
	pkgdesc="Arc GTK Theme"
	depends=""
	amove usr/share/themes/Arc/index.theme
}

arc_gtk3() {
	pkgdesc="GTK+3.0 assets for Arc"
	depends=""
	install_if="arc=$pkgver-r$pkgrel gtk+3.0"

	amove usr/share/themes/Arc/gtk-3.0
}

arc_gtk2() {
	pkgdesc="GTK+2.0 assets for Arc"
	depends="gtk-murrine-engine gnome-themes-extra"
	install_if="arc=$pkgver-r$pkgrel gtk+2.0"

	amove usr/share/themes/Arc/gtk-2.0
}

arc_gnome() {
	pkgdesc="GNOME Shell assets for Arc"
	depends=""
	install_if="arc=$pkgver-r$pkgrel gnome-shell"

	amove usr/share/themes/Arc/gnome-shell
}

arc_xfwm() {
	pkgdesc="xfwm assets for Arc"
	depends=""
	install_if="arc=$pkgver-r$pkgrel xfwm"

	amove usr/share/themes/Arc/xfwm4
}

arc_openbox() {
	pkgdesc="openbox assets for Arc"
	depends=""
	install_if="arc=$pkgver-r$pkgrel openbox"

	amove usr/share/themes/Arc/openbox-3
}

lighter() {
	pkgdesc="Lighter version of Arc"
	depends=""
	amove usr/share/themes/Arc-Lighter/index.theme
}

lighter_gtk3() {
	pkgdesc="GTK+3.0 assets for Lighter version of Arc"
	depends=""
	install_if="arc-lighter=$pkgver-r$pkgrel gtk+3.0"

	amove usr/share/themes/Arc-Lighter/gtk-3.0
}

lighter_gtk2() {
	pkgdesc="GTK+2.0 assets for Lighter version of Arc"
	depends="gtk-murrine-engine gnome-themes-extra"
	install_if="arc-lighter=$pkgver-r$pkgrel gtk+2.0"

	amove usr/share/themes/Arc-Lighter/gtk-2.0
}

lighter_gnome() {
	pkgdesc="GNOME Shell assets for Lighter version of Arc"
	depends=""
	install_if="arc-lighter=$pkgver-r$pkgrel gnome-shell"

	amove usr/share/themes/Arc-Lighter/gnome-shell
}

lighter_xfwm() {
	pkgdesc="xfwm assets for Lighter version of Arc"
	depends=""
	install_if="arc-lighter=$pkgver-r$pkgrel xfwm"

	amove usr/share/themes/Arc-Lighter/xfwm4
}

dark() {
	pkgdesc="Dark version of Arc"
	depends=""
	amove usr/share/themes/Arc-Dark/index.theme
}

dark_gtk3() {
	pkgdesc="GTK+3.0 assets for Dark version of Arc"
	depends=""
	install_if="arc-dark=$pkgver-r$pkgrel gtk+3.0"

	amove usr/share/themes/Arc-Dark/gtk-3.0
}

dark_gtk2() {
	pkgdesc="GTK+2.0 assets for Dark version of Arc"
	depends="gtk-murrine-engine gnome-themes-extra"
	install_if="arc-dark=$pkgver-r$pkgrel gtk+2.0"

	amove usr/share/themes/Arc-Dark/gtk-2.0
}

dark_gnome() {
	pkgdesc="GNOME Shell assets for Dark version of Arc"
	depends=""
	install_if="arc-dark=$pkgver-r$pkgrel gnome-shell"

	amove usr/share/themes/Arc-Dark/gnome-shell
}

dark_xfwm() {
	pkgdesc="xfwm assets for Dark version of Arc"
	depends=""
	install_if="arc-dark=$pkgver-r$pkgrel xfwm"

	amove usr/share/themes/Arc-Dark/xfwm4
}

dark_openbox() {
	pkgdesc="openbox assets for Dark version of Arc"
	depends=""
	install_if="arc-dark=$pkgver-r$pkgrel openbox"

	amove usr/share/themes/Arc-Dark/openbox-3
}

darker() {
	pkgdesc="Darker version of Arc"
	depends=""
	amove usr/share/themes/Arc-Darker/index.theme
}

darker_gtk3() {
	pkgdesc="GTK+3.0 assets for Darker version of Arc"
	depends=""
	install_if="arc-darker=$pkgver-r$pkgrel gtk+3.0"

	amove usr/share/themes/Arc-Darker/gtk-3.0
}

darker_gtk2() {
	pkgdesc="GTK+2.0 assets for Darker version of Arc"
	depends="gtk-murrine-engine gnome-themes-extra"
	install_if="arc-darker=$pkgver-r$pkgrel gtk+2.0"

	amove usr/share/themes/Arc-Darker/gtk-2.0
}

darker_xfwm() {
	pkgdesc="xfwm assets for Darker version of Arc"
	depends=""
	install_if="arc-darker=$pkgver-r$pkgrel xfwm"

	amove usr/share/themes/Arc-Darker/xfwm4
}

darker_openbox() {
	pkgdesc="openbox assets for Darker version of Arc"
	depends=""
	install_if="arc-darker=$pkgver-r$pkgrel openbox"

	amove usr/share/themes/Arc-Darker/openbox-3
}

sha512sums="4ec39053ccdd1f62cb80da660bf04b60e9aa6ca0ef9937fd0e033dc42196aeb85bb68928da3d92bb71eee302274033bf76fc10e73fc104171b05432758e56bdd  arc-theme-934e3bfc93506581f5be1194bd6084c5b6b64bf5.tar.gz"
